#!/bin/zsh

apt-get install procps -y
# 查找并杀死调度器进程
SCHEDULER_PID=$(pgrep -f "airflow scheduler")
if [ -n "$SCHEDULER_PID" ]; then
    echo "Stopping Airflow Scheduler (PID: $SCHEDULER_PID)"
    kill $SCHEDULER_PID
fi

# 等待几秒确保完全停止
sleep 5

# 启动调度器
echo "Starting Airflow Scheduler"
#airflow scheduler &

nohup airflow scheduler > scheduler.log 2>&1 &